package Action;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import Dao.machinedao;
import mapper.Machinemapper;

/**
 * Servlet implementation class NoDamageServlet
 */
@WebServlet("/NoDamageServlet")
public class NoDamageServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public NoDamageServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		Machinemapper machinemapper=new machinedao();
		String room =request.getParameter("room");
		String machine =request.getParameter("machine");
		machinemapper.setdamage(room,machine);
		request.setAttribute("room_id",room);
		request.getRequestDispatcher("DamageServlet").forward(request,response);
	}

}
